<?php
/*
 * @Yourtion 
 * http://www.yourtion.com
 * @copyright 2011
 */
session_start();
//if( isset($_SESSION['last_key']) ) header("Location: weibolist.php");
// include_once( 'config.php' );
include_once( 'tencentWeibo.php' );
// 创建 sinaOAuth 对象实例

$callBackURL = 'http://localhost:9000/sinao/callback.php';

$sinaOAuth = new WeiboOAuth(WB_AKEY , WB_SKEY,null,null);

$keys = $sinaOAuth->getRequestToken($callBackURL);
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$aurl = $sinaOAuth->getAuthorizeURL( $keys['oauth_token'] ,false ,$callBackURL);
// 保存到 session 中
$_SESSION['keys'] = $keys;

header('Location:'.$aurl);
?>
<a href="<?=$aurl?>">Use Oauth to login</a>